home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form WhoIsS1
- Caption = "WhoIs Sample Program"
- ClientHeight = 5445
- ClientLeft = 1095
- ClientTop = 2535
- ClientWidth = 9495
- Height = 5850
- Left = 1035
- LinkTopic = "Form1"
- LockControls = -1 'True
- ScaleHeight = 5445
- ScaleWidth = 9495
- Top = 2190
- Width = 9615
- Begin VB.CommandButton cmdExit
- Caption = "Exit WhoIs Sample"
- Height = 375
- Left = 6720
- TabIndex = 6
- Top = 1320
- Width = 2535
- End
- Begin VB.CommandButton cmdWhoIsQueryBlocking
- Caption = "WhoIs Query (Blocking)"
- Height = 375
- Left = 6720
- TabIndex = 5
- Top = 720
- Width = 2535
- End
- Begin VB.CommandButton cmdWhoIsQueryNonBlocking
- Caption = "WhoIs Query (Non-Blocking)"
- Height = 375
- Left = 6720
- TabIndex = 2
- Top = 240
- Width = 2535
- End
- Begin VB.TextBox txtQueryResults
- Height = 3255
- Left = 240
- Locked = -1 'True
- MultiLine = -1 'True
- ScrollBars = 3 'Both
- TabIndex = 1
- Top = 1920
- Width = 6135
- End
- Begin VB.TextBox txtQuery
- Height = 285
- Left = 240
- TabIndex = 0
- Top = 480
- Width = 6135
- End
- Begin VB.Label Label5
- Caption = $"whois.frx":0000
- Height = 1215
- Left = 6720
- TabIndex = 10
- Top = 3600
- Width = 2535
- End
- Begin WhoisLib.WhoIs WhoIs1
- Left = 9000
- Top = 4920
- _Version = 327680
- _ExtentX = 847
- _ExtentY = 847
- _StockProps = 64
- Blocking = -1 'True
- Query = ""
- Host = "WHOIS.INTERNIC.NET"
- End
- Begin VB.Label Label3
- Caption = $"whois.frx":00BF
- Height = 1575
- Left = 6720
- TabIndex = 9
- Top = 1920
- Width = 2535
- End
- Begin VB.Label lblErrorNumber
- BorderStyle = 1 'Fixed Single
- Height = 285
- Left = 240
- TabIndex = 7
- Top = 1320
- Width = 6135
- End
- Begin VB.Label Label2
- Caption = "Query Results:"
- Height = 255
- Left = 240
- TabIndex = 4
- Top = 1680
- Width = 1935
- End
- Begin VB.Label Label1
- Caption = "WhoIs Query:"
- Height = 255
- Left = 240
- TabIndex = 3
- Top = 240
- Width = 1935
- End
- Begin VB.Label Label4
- Caption = "Query Error Code:"
- Height = 255
- Left = 240
- TabIndex = 8
- Top = 1080
- Width = 1935
- End
- Attribute VB_Name = "WhoIsS1"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Option Explicit
- Private Sub cmdExit_Click()
- ' Get out.
- End
- End Sub
- Private Sub cmdWhoIsQueryBlocking_Click()
- Dim Index
- ' Clear results boxes.
- txtQueryResults.Text = ""
- lblErrorNumber.Caption = ""
- ' Start the query by getting the IP address
- ' of the InterNIC's WhoIs server. When this
- ' is complete, the rest of the query is
- ' handled by the WhoIs1_Done event
- ' event.
- Whois1.Blocking = True
- Whois1.Query = txtQuery.Text
- Whois1.GetWhoIs
- ' Place all of the results into the Query
- ' results text box.
- For Index = 0 To Whois1.ResponseCount - 1
- If Index <> 0 Then
- txtQueryResults.Text = txtQueryResults.Text & Chr(13) & Chr(10)
- End If
-
- txtQueryResults.Text = txtQueryResults.Text & Whois1.Response(Index)
- Next Index
- End Sub
- Private Sub cmdWhoIsQueryNonBlocking_Click()
- ' Clear results boxes.
- txtQueryResults.Text = ""
- lblErrorNumber.Caption = ""
- ' Start the query by getting the IP address
- ' of the InterNIC's WhoIs server. When this
- ' is complete, the rest of the query is
- ' handled by the WhoIs1_Done event
- ' event.
- On Error Resume Next
- Whois1.Blocking = False
- Whois1.Query = txtQuery.Text
- Whois1.GetWhoIs
- On Error GoTo 0
- End Sub
- Private Sub Whois1_Done(ErrorCode As Integer)
- Dim Index
- lblErrorNumber = "Error code: " & ErrorCode
- ' If we handled this in blocking (synchronous)
- ' mode, skip the rest (no need for it).
- If Whois1.Blocking Then
- Exit Sub
- End If
-
- ' Place all of the results into the Query
- ' results text box.
- For Index = 0 To Whois1.ResponseCount - 1
- If Index <> 0 Then
- txtQueryResults.Text = txtQueryResults.Text & Chr(13) & Chr(10)
- End If
-
- txtQueryResults.Text = txtQueryResults.Text & Whois1.Response(Index)
- Next Index
- End Sub
-